<?php
/*
 *      default.php
 *      
 *      Copyright 2010 Michael Gyen <GyenMic@autartica.be>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
defined('_JEXEC') or die('Restricted access'); 
//include_once(JPATH_COMPONENT.DS.'includes'.DS.'companyheader.php');
include_once(JPATH_COMPONENT.DS.'includes'.DS.'autartiheader.php');
$document =& JFactory::getDocument();
$document->addScriptDeclaration( "
 function tableOrdering( order, dir, task ) {
  var form = document.adminForm;
  form.filter_order.value = order;
  form.filter_order_Dir.value = dir;
  form.submit( task );
 }"
);
?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
<table class="adminlist">
<thead>
<tr>
	<th width="5"><?php echo JText::_( 'NUM' ); ?></th>
	<th width="20"> <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" /></th>
	<th class="title"><?php echo JHTML::_('grid.sort', 'POSITION', 'position',$this->lists[1], $this->lists[0] ); ?></th>
	<th class="title"><?php echo JHTML::_('grid.sort', 'TOWN', 'town',$this->lists[1], $this->lists[0] ); ?></th>
	<th class="title"><?php echo JHTML::_('grid.sort', 'START', 'start',$this->lists[1], $this->lists[0] ); ?></th>
	<th width="5%" align="center"><?php echo JHTML::_('grid.sort', 'Published','published', $this->lists[1], $this->lists[0] ); ?>	</th>
	<th width="1%" nowrap="nowrap"><?php echo JHTML::_('grid.sort', 'ID', 'id',$this->lists[1], $this->lists[0] ); ?></th>
</tr>
</thead>
<?php
  $k = 0;
  for ($i=0, $n=count( $this->items ); $i < $n; $i++){
    $row = &$this->items[$i];
    $published = JHTML::_('grid.published', $row, $i );
    $checked 	= JHTML::_('grid.id',   $i, $row->id );
    $link = JRoute::_( 'index.php?option=com_autartijobs&controller=autartijob&task=edit&cid[]='.$row->id );
    ?>
    <tr class="<?php echo "row$k"; ?>">
		<td><?php echo $row->id; ?></td>
		<td><?php echo $checked; ?></td>
		<td><a href="<?php echo $link; ?>"><?php echo $row->position; ?></a></td>
		<td><a href="<?php echo $link; ?>"><?php echo $row->town ?></a></td>
		<td><a href="<?php echo $link; ?>"><?php echo $row->start ?></a></td>
		<td align="center"><?php echo $published;?></td>
		<td align="center"><?php echo $row->id; ?></td>
    </tr>
    <?php
    $k = 1 - $k;
  }
?>
<tfoot>
    <tr>
      <td colspan="9"><?php echo $this->pagination->getListFooter(); ?></td>
    </tr>
  </tfoot>
</table></div>
<input type="hidden" name="option" value="com_autartijobs" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="autartijob" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists[0]; ?>" />
 <input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists[1]; ?>" />
</form>
<?php include_once(JPATH_COMPONENT.DS.'includes'.DS.'autartifooter.php');?>
